<?php
namespace App\Transformers;

use League\Fractal\TransformerAbstract;
use App\Model\ProductSaleDay;

class ProductSaleDayTransformer extends TransformerAbstract{

    public function transform(ProductSaleDay $item){
        return [
            'id' => $item->id,
            'product' => $item->product()->first(),
            'date' => $item->date,
            'sale_count' => $item->sale_count,
            'total_amount' => $item->total_amount
        ];
    }
}